package com.gmail.dengtao.joe.game.server.client.protocol;

/**
 * // protocol
 * // action|type|x|y|size|red|blue|green
 * action = 1 draw
 * type 1:point 2 line
 * @author <a href="mailto:joe.dengtao@gmail.com">DengTao</a>
 * @version 1.0
 * @since 1.0
 */
public class DrawProtocol {

	private int action;
	private int type;
	private int x;
	private int y;
	private int size;
	private int red;
	private int blue;
	private int green;
	
	public DrawProtocol(String data) {
		String[] params = data.split("\\|");
		action = Integer.parseInt(params[0]);
		type = Integer.parseInt(params[1]);
		x = Integer.parseInt(params[2]);
		y = Integer.parseInt(params[3]);
		size = Integer.parseInt(params[4]);
		red = Integer.parseInt(params[5]);
		blue = Integer.parseInt(params[6]);
		green = Integer.parseInt(params[7]);
	}
	
	public int getAction() {
		return action;
	}
	
	public void setAction(int action) {
		this.action = action;
	}
	
	public int getType() {
		return type;
	}
	
	public void setType(int type) {
		this.type = type;
	}
	
	public int getX() {
		return x;
	}
	
	public void setX(int x) {
		this.x = x;
	}
	
	public int getY() {
		return y;
	}
	
	public void setY(int y) {
		this.y = y;
	}
	
	public int getSize() {
		return size;
	}
	
	public void setSize(int size) {
		this.size = size;
	}
	
	public int getRed() {
		return red;
	}
	
	public void setRed(int red) {
		this.red = red;
	}
	
	public int getBlue() {
		return blue;
	}
	
	public void setBlue(int blue) {
		this.blue = blue;
	}
	
	public int getGreen() {
		return green;
	}
	
	public void setGreen(int green) {
		this.green = green;
	}
	
}
